<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/1/2
 * Time: 11:50
 */
namespace app\api\model;

use think\Db;
use think\Model;

class PassengerModel extends Model
{
    public function addPassenger($data)
    {
        return Db::table('xm_passenger')->insertGetId($data);
    }

    public function updatePassenger($map,$data)
    {
        return Db::table('xm_passenger')->where($map)->update($data);
    }

    public function getPassenger($map,$field='*',$flag = true,$page=1,$limit=10)
    {
        return $flag ? Db::table('xm_passenger')->where($map)->field($field)->page($page,$limit)->order('passenger_id desc')->select()
            :Db::table('xm_passenger')->where($map)->field($field)->find();
    }

}